﻿using CommonType;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using S_Examine.Domains.Entity;
using S_Examine.Read.API.Application.Commands.AssessmentIndexCommand;

namespace S_Examine.Read.API.Controllers
{
	/// <summary>
	/// 考核指标管理API接口(读)
	/// </summary>
	[Route("api/[controller]/[action]")]
	[ApiController]
	public class AssessmentIndexReadController : ControllerBase
	{
		private readonly IMediator _mediator;

		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name="mediator"></param>
		public AssessmentIndexReadController(IMediator mediator)
		{
			_mediator = mediator;
		}

		/// <summary>
		/// 考核指标管理的分页显示功能接口
		/// </summary>
		/// <param name="command"></param>
		/// <returns></returns>
		[HttpGet]
		public Task<ApiResule<PageResule<AssessmentIndex>>> GetAssessmentIndexList([FromQuery] AssessmentIndexQueryCommand command)
		{
			return _mediator.Send(command);
		}
	}
}
